/**
 *
 *  @author ala
 *  @date 2024-09-20 18:47
 */
package dto

import (
	_ "container/heap"
)

type Class struct {
	Students *StudentAges
}
type StudentAges []*Student

func (sa *StudentAges) Len() int {
	return len(*sa)
}
func (sa *StudentAges) Less(i, j int) bool {
	_sa := *sa
	return _sa[i].Age < _sa[j].Age
}
func (sa *StudentAges) Swap(i, j int) {
	_sa := *sa
	_sa[i], _sa[j] = _sa[j], _sa[i]
}
func (sa *StudentAges) Push(x interface{}) {
	*sa = append(*sa, x.(*Student))
}
func (sa *StudentAges) Pop() interface{} {
	_sa, n := *sa, len(*sa)
	last := _sa[n-1]
	*sa = _sa[0 : n-1]
	_sa[n-1] = nil
	return last
}
